package homework;

import java.util.Scanner;

public class Caesar_Cipher {
	public static void main(String[] args) {
		 // 请在Begin-End间编写完整代码
	    /********** Begin **********/
	    // 接收给定字符串
	    Scanner scanner = new Scanner(System.in);
	    String input = scanner.nextLine();
	    
	    // 将输入分割为偏移量和密文
	    String[] parts = input.split(" ");
	    int offset = Integer.parseInt(parts[0]);
	    String cipherText = parts[1];
	    
	    // 将密文转换为字符数组
	    char[] cipherChars = cipherText.toCharArray();
	    
	    // 破解密文
	    StringBuilder plainText = new StringBuilder();
	    for (char c : cipherChars) {
	        // 解密每个字符
	        char decryptedChar = (char) ((c - 'A' + offset) % 26 + 'A');
	        plainText.append(decryptedChar);
	    }
	    
	    // 输出明文
	    System.out.println(plainText.toString());
	    /********** End **********/
	}

}
